/*
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
/*
 * Warning! This file is generated. Modify at your own risk.
 */

package com.google.api.services.gan.model;

import com.google.api.client.http.HttpHeaders;
import com.google.api.client.json.GenericJson;
import com.google.api.client.json.JsonString;
import com.google.api.client.util.DateTime;

/**
 * An EventResource.
 *
 * <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Google Affiliate Network API. For a detailed
 * explanation see:
 * <a href="http://code.google.com/p/google-api-java-client/wiki/Json">http://code.google.com/p/google-api-java-client/wiki/Json</a>
 * </p>
 *
 * @author Google, Inc.
 */
public final class Event extends GenericJson {

  /**
   * Fee that the advertiser paid to the Google Affiliate Network.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private Money networkFee;

  /**
   * The name of the advertiser for this event.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private String advertiserName;

  /**
   * The kind for one event.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private String kind;

  /**
   * The date-time this event was last modified as a RFC 3339 date-time value.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private DateTime modifyDate;

  /**
   * Type of the event (action|transaction|charge).
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private String type;

  /**
   * The order ID for this event. Only returned for conversion events.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private String orderId;

  /**
   * The name of the publisher for this event.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private String publisherName;

  /**
   * The ID of the member attached to this event. Only returned for conversion events.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private String memberId;

  /**
   * The ID of advertiser for this event.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key @JsonString
  private Long advertiserId;

  /**
   * Status of the event (active|canceled). Only returned for charge and conversion events.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private String status;

  /**
   * The charge ID for this event. Only returned for charge events.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private String chargeId;

  /**
   * Products associated with the event.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<Products> products;

  static {
    // hack to force ProGuard to consider Products used, since otherwise it would be stripped out
    // see http://code.google.com/p/google-api-java-client/issues/detail?id=528
    com.google.api.client.util.Data.nullOf(Products.class);
  }

  /**
   * Earnings by the publisher.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private Money earnings;

  /**
   * Charge type of the event (other|slotting_fee|monthly_minimum|tier_bonus|debit|credit). Only
   * returned for charge events.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private String chargeType;

  /**
   * Fee that the advertiser paid to the publisher.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private Money publisherFee;

  /**
   * Amount of money exchanged during the transaction. Only returned for charge and conversion
   * events.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private Money commissionableSales;

  /**
   * The ID of the publisher for this event.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key @JsonString
  private Long publisherId;

  /**
   * The date-time this event was initiated as a RFC 3339 date-time value.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private DateTime eventDate;

  /**
   * Fee that the advertiser paid to the Google Affiliate Network.
   * The value returned may be {@code null}.
   */
  public Money getNetworkFee() {
    return networkFee;
  }

  /**
   * Fee that the advertiser paid to the Google Affiliate Network.
   * The value set may be {@code null}.
   */
  public Event setNetworkFee(Money networkFee) {
    this.networkFee = networkFee;
    return this;
  }

  /**
   * The name of the advertiser for this event.
   * The value returned may be {@code null}.
   */
  public String getAdvertiserName() {
    return advertiserName;
  }

  /**
   * The name of the advertiser for this event.
   * The value set may be {@code null}.
   */
  public Event setAdvertiserName(String advertiserName) {
    this.advertiserName = advertiserName;
    return this;
  }

  /**
   * The kind for one event.
   * The value returned may be {@code null}.
   */
  public String getKind() {
    return kind;
  }

  /**
   * The kind for one event.
   * The value set may be {@code null}.
   */
  public Event setKind(String kind) {
    this.kind = kind;
    return this;
  }

  /**
   * The date-time this event was last modified as a RFC 3339 date-time value.
   * The value returned may be {@code null}.
   */
  public DateTime getModifyDate() {
    return modifyDate;
  }

  /**
   * The date-time this event was last modified as a RFC 3339 date-time value.
   * The value set may be {@code null}.
   */
  public Event setModifyDate(DateTime modifyDate) {
    this.modifyDate = modifyDate;
    return this;
  }

  /**
   * Type of the event (action|transaction|charge).
   * The value returned may be {@code null}.
   */
  public String getType() {
    return type;
  }

  /**
   * Type of the event (action|transaction|charge).
   * The value set may be {@code null}.
   */
  public Event setType(String type) {
    this.type = type;
    return this;
  }

  /**
   * The order ID for this event. Only returned for conversion events.
   * The value returned may be {@code null}.
   */
  public String getOrderId() {
    return orderId;
  }

  /**
   * The order ID for this event. Only returned for conversion events.
   * The value set may be {@code null}.
   */
  public Event setOrderId(String orderId) {
    this.orderId = orderId;
    return this;
  }

  /**
   * The name of the publisher for this event.
   * The value returned may be {@code null}.
   */
  public String getPublisherName() {
    return publisherName;
  }

  /**
   * The name of the publisher for this event.
   * The value set may be {@code null}.
   */
  public Event setPublisherName(String publisherName) {
    this.publisherName = publisherName;
    return this;
  }

  /**
   * The ID of the member attached to this event. Only returned for conversion events.
   * The value returned may be {@code null}.
   */
  public String getMemberId() {
    return memberId;
  }

  /**
   * The ID of the member attached to this event. Only returned for conversion events.
   * The value set may be {@code null}.
   */
  public Event setMemberId(String memberId) {
    this.memberId = memberId;
    return this;
  }

  /**
   * The ID of advertiser for this event.
   * The value returned may be {@code null}.
   */
  public Long getAdvertiserId() {
    return advertiserId;
  }

  /**
   * The ID of advertiser for this event.
   * The value set may be {@code null}.
   */
  public Event setAdvertiserId(Long advertiserId) {
    this.advertiserId = advertiserId;
    return this;
  }

  /**
   * Status of the event (active|canceled). Only returned for charge and conversion events.
   * The value returned may be {@code null}.
   */
  public String getStatus() {
    return status;
  }

  /**
   * Status of the event (active|canceled). Only returned for charge and conversion events.
   * The value set may be {@code null}.
   */
  public Event setStatus(String status) {
    this.status = status;
    return this;
  }

  /**
   * The charge ID for this event. Only returned for charge events.
   * The value returned may be {@code null}.
   */
  public String getChargeId() {
    return chargeId;
  }

  /**
   * The charge ID for this event. Only returned for charge events.
   * The value set may be {@code null}.
   */
  public Event setChargeId(String chargeId) {
    this.chargeId = chargeId;
    return this;
  }

  /**
   * Products associated with the event.
   * The value returned may be {@code null}.
   */
  public java.util.List<Products> getProducts() {
    return products;
  }

  /**
   * Products associated with the event.
   * The value set may be {@code null}.
   */
  public Event setProducts(java.util.List<Products> products) {
    this.products = products;
    return this;
  }

  /**
   * Earnings by the publisher.
   * The value returned may be {@code null}.
   */
  public Money getEarnings() {
    return earnings;
  }

  /**
   * Earnings by the publisher.
   * The value set may be {@code null}.
   */
  public Event setEarnings(Money earnings) {
    this.earnings = earnings;
    return this;
  }

  /**
   * Charge type of the event (other|slotting_fee|monthly_minimum|tier_bonus|debit|credit). Only
   * returned for charge events.
   * The value returned may be {@code null}.
   */
  public String getChargeType() {
    return chargeType;
  }

  /**
   * Charge type of the event (other|slotting_fee|monthly_minimum|tier_bonus|debit|credit). Only
   * returned for charge events.
   * The value set may be {@code null}.
   */
  public Event setChargeType(String chargeType) {
    this.chargeType = chargeType;
    return this;
  }

  /**
   * Fee that the advertiser paid to the publisher.
   * The value returned may be {@code null}.
   */
  public Money getPublisherFee() {
    return publisherFee;
  }

  /**
   * Fee that the advertiser paid to the publisher.
   * The value set may be {@code null}.
   */
  public Event setPublisherFee(Money publisherFee) {
    this.publisherFee = publisherFee;
    return this;
  }

  /**
   * Amount of money exchanged during the transaction. Only returned for charge and conversion
   * events.
   * The value returned may be {@code null}.
   */
  public Money getCommissionableSales() {
    return commissionableSales;
  }

  /**
   * Amount of money exchanged during the transaction. Only returned for charge and conversion
   * events.
   * The value set may be {@code null}.
   */
  public Event setCommissionableSales(Money commissionableSales) {
    this.commissionableSales = commissionableSales;
    return this;
  }

  /**
   * The ID of the publisher for this event.
   * The value returned may be {@code null}.
   */
  public Long getPublisherId() {
    return publisherId;
  }

  /**
   * The ID of the publisher for this event.
   * The value set may be {@code null}.
   */
  public Event setPublisherId(Long publisherId) {
    this.publisherId = publisherId;
    return this;
  }

  /**
   * The date-time this event was initiated as a RFC 3339 date-time value.
   * The value returned may be {@code null}.
   */
  public DateTime getEventDate() {
    return eventDate;
  }

  /**
   * The date-time this event was initiated as a RFC 3339 date-time value.
   * The value set may be {@code null}.
   */
  public Event setEventDate(DateTime eventDate) {
    this.eventDate = eventDate;
    return this;
  }

  private HttpHeaders responseHeaders;

  /**
   * Sets the HTTP headers returned with the server response, or <code>null</code>.
   *
   * This member should only be non-null if this object was the top level element of a response. For
   * example, a request that returns a single {@link Event} would include the response headers,
   * while a request which returns an array of {@link Event}, would have a non-null response header
   * in the enclosing object only.
   */
  public void setResponseHeaders(HttpHeaders responseHeaders) {
    this.responseHeaders = responseHeaders;
  }

  /**
   * Returns the HTTP headers that were returned with the server response, or
   * <code>null</code>.
   */
  public HttpHeaders getResponseHeaders() {
    return responseHeaders;
  }

  /**
   * Model definition for EventProducts.
   */
  public static final class Products extends GenericJson {

    /**
     * Fee that the advertiser paid to the Google Affiliate Network for this product.
     * The value may be {@code null}.
     */
    @com.google.api.client.util.Key
    private Money networkFee;

    /**
     * Sku of this product.
     * The value may be {@code null}.
     */
    @com.google.api.client.util.Key
    private String sku;

    /**
     * Name of the category this product belongs to.
     * The value may be {@code null}.
     */
    @com.google.api.client.util.Key
    private String categoryName;

    /**
     * Sku name of this product.
     * The value may be {@code null}.
     */
    @com.google.api.client.util.Key
    private String skuName;

    /**
     * Fee that the advertiser paid to the publisehr for this product.
     * The value may be {@code null}.
     */
    @com.google.api.client.util.Key
    private Money publisherFee;

    /**
     * Amount earned by the publisher on this product.
     * The value may be {@code null}.
     */
    @com.google.api.client.util.Key
    private Money earnings;

    /**
     * Price per unit of this product.
     * The value may be {@code null}.
     */
    @com.google.api.client.util.Key
    private Money unitPrice;

    /**
     * Id of the category this product belongs to.
     * The value may be {@code null}.
     */
    @com.google.api.client.util.Key
    private String categoryId;

    /**
     * Quantity of this product bought/exchanged.
     * The value may be {@code null}.
     */
    @com.google.api.client.util.Key @JsonString
    private Long quantity;

    /**
     * Fee that the advertiser paid to the Google Affiliate Network for this product.
     * The value returned may be {@code null}.
     */
    public Money getNetworkFee() {
      return networkFee;
    }

    /**
     * Fee that the advertiser paid to the Google Affiliate Network for this product.
     * The value set may be {@code null}.
     */
    public Products setNetworkFee(Money networkFee) {
      this.networkFee = networkFee;
      return this;
    }

    /**
     * Sku of this product.
     * The value returned may be {@code null}.
     */
    public String getSku() {
      return sku;
    }

    /**
     * Sku of this product.
     * The value set may be {@code null}.
     */
    public Products setSku(String sku) {
      this.sku = sku;
      return this;
    }

    /**
     * Name of the category this product belongs to.
     * The value returned may be {@code null}.
     */
    public String getCategoryName() {
      return categoryName;
    }

    /**
     * Name of the category this product belongs to.
     * The value set may be {@code null}.
     */
    public Products setCategoryName(String categoryName) {
      this.categoryName = categoryName;
      return this;
    }

    /**
     * Sku name of this product.
     * The value returned may be {@code null}.
     */
    public String getSkuName() {
      return skuName;
    }

    /**
     * Sku name of this product.
     * The value set may be {@code null}.
     */
    public Products setSkuName(String skuName) {
      this.skuName = skuName;
      return this;
    }

    /**
     * Fee that the advertiser paid to the publisehr for this product.
     * The value returned may be {@code null}.
     */
    public Money getPublisherFee() {
      return publisherFee;
    }

    /**
     * Fee that the advertiser paid to the publisehr for this product.
     * The value set may be {@code null}.
     */
    public Products setPublisherFee(Money publisherFee) {
      this.publisherFee = publisherFee;
      return this;
    }

    /**
     * Amount earned by the publisher on this product.
     * The value returned may be {@code null}.
     */
    public Money getEarnings() {
      return earnings;
    }

    /**
     * Amount earned by the publisher on this product.
     * The value set may be {@code null}.
     */
    public Products setEarnings(Money earnings) {
      this.earnings = earnings;
      return this;
    }

    /**
     * Price per unit of this product.
     * The value returned may be {@code null}.
     */
    public Money getUnitPrice() {
      return unitPrice;
    }

    /**
     * Price per unit of this product.
     * The value set may be {@code null}.
     */
    public Products setUnitPrice(Money unitPrice) {
      this.unitPrice = unitPrice;
      return this;
    }

    /**
     * Id of the category this product belongs to.
     * The value returned may be {@code null}.
     */
    public String getCategoryId() {
      return categoryId;
    }

    /**
     * Id of the category this product belongs to.
     * The value set may be {@code null}.
     */
    public Products setCategoryId(String categoryId) {
      this.categoryId = categoryId;
      return this;
    }

    /**
     * Quantity of this product bought/exchanged.
     * The value returned may be {@code null}.
     */
    public Long getQuantity() {
      return quantity;
    }

    /**
     * Quantity of this product bought/exchanged.
     * The value set may be {@code null}.
     */
    public Products setQuantity(Long quantity) {
      this.quantity = quantity;
      return this;
    }

  }

}
